
{%extends 'base_foot.html'%}
{% block head %}
	<div class="header_con">
		<div class="header">
			<div class="welcome fl">欢迎来到天天水果!</div>
			<div class="fr">
				{%if request.session.user_name|default:'' != ''%}
				<div class="login_btn fl">
					欢迎您：<em>{{request.session.user_name}}</em>
					<span>|</span>
					<a href="/user/logout/">退出</a>
				</div>
				{%else%}
				<div class="login_btn fl">
					<a href="/user/login/">登录</a>
					<span>|</span>
					<a href="/user/register/">注册</a>
				</div>
				{%endif%}
				<div class="user_link fl">
					<span>|</span>
					<a href="/user/info/">用户中心</a>
					<span>|</span>
					<a href="/cart/">我的购物车</a>
					<span>|</span>
					<a href="/user/order/">我的订单</a>
				</div>
			</div>
		</div>		
	</div>

	<div class="search_bar clearfix">
		<a href="/goods/" class="logo fl"><img src="/static/images/logo1.png"></a>
		<div class="sub_page_name fl">|&nbsp;&nbsp;&nbsp;&nbsp;用户中心</div>
		<div class="search_con fr">
			<!--<input type="text" class="input_text fl" name="" placeholder="搜索商品">-->
			<!--<input type="button" class="input_btn fr" name="" value="搜索">-->
			<form method='get' action='/goods/search/' target='_blank'>
				<input type="text" class="input_text fl" name="q" placeholder="搜索商品">
				<input type="submit" class="input_btn fr"  value="搜索">
			</form>
		</div>		
	</div>

	<div class="main_con clearfix">
		<div class="left_menu_con clearfix">
			<h3>用户中心</h3>
			<ul>
				<li><a href="/user/info/">· 个人信息</a></li>
				<li><a href="/user/order/" class="active">· 全部订单</a></li>
				<li><a href="/user/site/">· 收货地址</a></li>
			</ul>
		</div>
		<div class="right_content clearfix">
				<h3 class="common_title2">全部订单</h3>
    {%if paginator.count > 0%}
		  {%for order in page%}
				<ul class="order_list_th w978 clearfix">
					<li class="col01">{{order.odate}}</li>
					<li class="col02">订单号：{{order.oid}}</li>
					<li class="col02 stress">{%if order.oIsPay%}已支付{%else%}未支付{%endif%}</li>
				</ul>

				<table class="order_list_table w980">
					<tbody>
						<tr>
							<td width="55%">
							   {%for detail in order.orderdetailinfo_set.all%}
								<ul class="order_goods_list clearfix">
									<li class="col01"><img src="/static/{{detail.goods.gpic}}"></li>
									<li class="col02">{{detail.goods.gtitle|slice:'10'}}<em><span>{{detail.price}}</span>元/{{detail.goods.gunit}}</em></li>
									<li class="col03">{{detail.count}}</li>
									<li class="col04"> </li>
								</ul>
								{%endfor%}
								</td>
							<td width="15%">{{order.ototal}}元</td>
							{%if order.oIsPay%}
							<td width="15%">已付款</td>
							<td width="15%"><a href="#" class="oper_btn">查看物流</a></td>
							{%else%}
						<td width="15%">待付款</td>
						<td width="15%"><a href="/order/pay{{order.oid}}/" class="oper_btn">去付款</a></td>
						{%endif%}
						</tr>
					</tbody>
				</table>
      {%endfor%}

				<div class="pagenation">
				{%if page.has_previous%}
					<a href="/user/order{{page.previous_page_number}}"><上一页</a>
					{%endif%}

					{%for pindex in paginator.page_range%}
					{%if pindex == page.number%}
					<a href="#" class=active>{{pindex}}</a>
					{%else%}
					<a href="/user/order{{pindex}}/">{{pindex}}</a>
					{%endif%}
					{%endfor%}

					{%if page.has_next%}
					<a href="/user/order{{page.next_page_number}}/">下一页></a>
					{%endif%}
					</div>
					{%else%}
				暂无订单信息
				{%endif%}
		</div>
	</div>


{%endblock head %}
{% block body %} {%endblock body%}

